﻿#historyholder
  -var history = ViewData["history"] as List<OrderHistory>
  %label
    Последний комментарий:  
    %a#switchhistory.noul.small{href="#", onclick="return switchHistory(this);"}&darr; Вся история изменений
  .history
    .first      
      -var last = (history != null && history.Count > 0) ? history.FirstOrDefault(e => !String.IsNullOrEmpty(e.Comment)) : null;
      -if (last != null)
        =String.Format("{0} {1} {2} [{3}] <span class=\"comment\">{4}</span>", last.Operation, last.Date.ToString(), last.User.FIO, last.Status.Name, HTMLHelper.EscapeHTML(last.Comment).ReplaceUrlsWithLinks().Replace(Environment.NewLine,"<br/>"))
      -else
        Нет комментариев
    -if(history != null && history.Count > 0)    
      -foreach(OrderHistory e in history)
        .item.hidden
          =String.Format("{0} {1} {2} [{3}] <span class=\"comment\">{4}</span>", e.Operation, e.Date.ToString(), e.User.FIO, e.Status.Name, String.IsNullOrEmpty(e.Comment) ? "" : HTMLHelper.EscapeHTML(e.Comment).ReplaceUrlsWithLinks().Replace(Environment.NewLine,"<br/>"))